package community.hospital.convert;

import community.hospital.entity.Role;
import community.hospital.entity.request.RoleRequest;

import community.hospital.entity.response.RoleInfo;
import community.hospital.entity.response.RoleResponse;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @Author：ydj
 * @Date：2023/1/26 14:48
 */
@Mapper
public interface RoleConvert {
    RoleConvert INSTANCE = Mappers.getMapper(RoleConvert.class);

    Role convertToRole(RoleRequest request);

    //    Role convertToRole(UpdateRoleRequest request);
    RoleResponse convertToResp(Role role);

    @Mapping(source = "roleCode",target = "value")
    RoleInfo convertToRoleInfo(Role role);
}
